package com.qbt.unipock.agent.interfaces;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.master.po.Distributor;
import com.xjoyt.pay.merchant.register.params.DistributorPageParam;
import com.xjoyt.pay.params.ChangePasswordParam;
import com.xjoyt.pay.params.LoginParam;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

public interface DistributorContract {
	@ApiOperation(value = "根据id查询返回", httpMethod = "POST")
	@RequestMapping("get/{id}")
	Distributor get(@PathVariable("id") String id);
	
	@RequestMapping(value = "loadPage", method = RequestMethod.POST)
	PageResult<Distributor> loadPage(@RequestBody PageParam<DistributorPageParam> param);
	@ApiOperation(value="增加代理商户", notes="根据url的传递过来的值增加")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "代理商ID", required = true),
            @ApiImplicitParam(name = "name", value = "代理商名称", required = true)
    })
	@RequestMapping(value = "create", method = RequestMethod.POST)
	ExecuteResult<?> create(Distributor param);

	/**
	 * 通过商户号获取代理商
	 * 
	 * @param no
	 * @return
	 */
	@RequestMapping("getByNo/{no}")
	Distributor getByNo(@PathVariable("no") String no);

	/**
	 * 重置密钥
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping("resetKey/{id}")
	ExecuteResult<String> resetKey(@PathVariable("id") String id);

	/**
	 * 代理商登录
	 * 
	 * @param param
	 * @return
	 */
	
	@RequestMapping(value = "getForLogin", method = RequestMethod.POST)
	ExecuteResult<Distributor> getForLogin(LoginParam param);

	/**
	 * 修改代理商密码
	 * 
	 * @param param
	 * @return
	 */
	@RequestMapping(value = "changePassword", method = RequestMethod.POST)
	ExecuteResult<?> changePassword(ChangePasswordParam param);

	/**
	 * 修改
	 * 
	 * @param param
	 * @return
	 */
	@RequestMapping(value = "update", method = RequestMethod.POST)
	ExecuteResult<Distributor> update(Distributor param);

	

}
